//
//  ViewController.swift
//  LXApp
//
//  Created by lxpray@163.com on 08/18/2021.
//  Copyright (c) 2021 lxpray@163.com. All rights reserved.
//

import UIKit
import LXAppInfo

class ViewController: UIViewController {
    var timer: Timer?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        print("appName: \(LXApp.appName)")
        print("appVersion: \(LXApp.appVersion)")
        print("appBuildVersion: \(LXApp.appBuildVersion)")
        print("bundleIdentifier: \(LXApp.bundleIdentifier)")
        print("platformName: \(LXApp.platformName)")
        print("modelName: \(LXApp.modelName)")
        print("isBeingDebugged: \(LXApp.isBeingDebugged)")
        print("isJailbroken: \(LXApp.isJailbroken)")
//        print("WIFI: \(LXApp.wifiInfo?.description)")

        print("deviceIP: \(LXApp.deviceIP)")
        
        print("appIsFirstLaunch: \(LXApp.appIsFirstLaunch)")
        print("appVersionIsFirstLaunch: \(LXApp.appVersionIsFirstLaunch)")

        timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { _ in
            print("cpu: \(LXApp.cpuUsage)")
            print("memory: used \(LXApp.sizeToString(fileSize: LXApp.memorySize.used, unit: 1024)), total: \(LXApp.sizeToString(fileSize: LXApp.memorySize.total, unit: 1024)))")
            print("disk: used \(LXApp.sizeToString(fileSize: LXApp.diskSize.used)), total: \(LXApp.sizeToString(fileSize: LXApp.diskSize.total))")
        })
        timer?.fire()


    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}

